

gotoArticle = function(des, obj) {
	mui.openWindow({
		url: des,
		extras: {
			dataid: $(obj).data("url")
		}
	});

}

addarticle = function(data) {
	if(data.code == "1") {
		for(var key in data.value) {
			var dom = '<li class="mui-table-view-cell mui-media" data-url ="' + data.value[key].ps_id + '" onclick="gotoArticle(\'sub_community_detail.html\',this)"> \
						<a href="javascript:;"> \
							<img class="mui-media-object mui-pull-left" src="' + data.value[key].image + '"> \
							<div class="mui-media-body"> \
								<span id="author">&nbsp;</span><span id="time" class="mui-pull-right">' + data.value[key].time + '</span> \
								<div id="title">' + data.value[key].title + '</div> \
								<p class="mui-ellipsis">' + data.value[key].summary + '</p> \
							</div> \
						</a> \
					</li>';
			$("p").addClass("mui-ellipsis");
			$("#spread").append(dom);
		}
	}
}

gotoerror = function() {

		var dom = '<div style="text-align:center;margin-top:30px;color:grey;"> \
						热门帖子加载中...请下拉刷新\
					</div>';
		$("#spread").append(dom);

}

window.onload = function() {

	}
	//{"code":"1","msg":"查询文章成功","data":[{"id":"43221321312213","title":"1idolly is good","time":"20160810103715","image":"http://cdn.codingx.cn/wp-content/uploads/2016/07/entrepreneurship.jpg","description":"idolly is good1.","url":"http://www.codingx.cn/entrepreneurship/"},{"id":"353212321","title":"2idolly is good","time":"20150810103715","image":"content/uploads/2016/07/entrepreneurship.jpg","description":"idolly is good2.","url":"http://www.codingx.cn/entrepreneurship/"}]}